package com.qingke.learnRegex;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class VerifyEmail {

	public static void main(String[] args) {
		String[] emails = {"af235@fvagq.com"};
		for (String email: emails) {
			isMatch(email);
		}
	}
	
	public static boolean isMatch(String str) {
		String regex = "\\w+@\\w+\\.com";
		Pattern pattern = Pattern.compile(regex);
		Matcher matcher = pattern.matcher(str);
		System.out.println(str + ": " + matcher.matches());
		return matcher.matches();
	}

}
